package com.ctshk.sapp.order.localfun.controller;

import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.rpc.order.localfun.dto.LocalFunOrderCollectionDTO;
import com.ctshk.rpc.order.localfun.req.LocalFunOrderCollectionConfirmationReq;
import com.ctshk.rpc.order.localfun.req.LocalFunOrderCollectionReq;
import com.ctshk.rpc.order.localfun.service.ILocalFunOrderCollectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import com.ctshk.common.web.support.BaseController;

import java.util.List;

/**
 * <p>
 * 收款明细 前端控制器
 * </p>
 *
 * @author gzl-wansi001
 * @since 2021-02-24
 */
@Api(value="门票收款明细", tags="门票收款明细")
@RestController
@RequestMapping("/localFun/order/collection")
public class LocalFunOrderCollectionController extends BaseController {

    @DubboReference
    private ILocalFunOrderCollectionService iLocalFunOrderCollectionService;

    @ApiOperation(value = "订单中心 - 操作订单收款记录", notes = "订单中心 - 操作订单收款记录(陈雷)")
    @OperationLogAnnotation(operModul = OperationLogModel.ORDER, operType = OperationLogType.QUERY, operTitle = "订单中心 - 操作订单收款记录", operDesc = "订单中心 - 操作订单收款记录")
    @PostMapping(value = "/list")
    public Result<List<LocalFunOrderCollectionDTO>> list(@RequestBody LocalFunOrderCollectionReq localFunOrderCollectionReq){
        return iLocalFunOrderCollectionService.list(localFunOrderCollectionReq);
    }

    @ApiOperation(value = "订单中心 - 操作订单收款记录再次确认", notes = "订单中心 - 操作订单收款记录再次确认(陈雷)")
    @OperationLogAnnotation(operModul = OperationLogModel.ORDER, operType = OperationLogType.UPDATE, operTitle = "订单中心 - 操作订单收款记录再次确认", operDesc = "订单中心 - 操作订单收款记录再次确认")
    @PostMapping(value = "/confirmation")
    public Result<Long> confirmation(@RequestBody LocalFunOrderCollectionConfirmationReq localFunOrderCollectionConfirmationReq){
        return iLocalFunOrderCollectionService.confirmation(localFunOrderCollectionConfirmationReq,getCurrentUser(getRequest()));
    }

}
